﻿using Unity.Mathematics;
using Unity.Transforms;
using UnityEngine;

public class CameraSingleton : MonoBehaviour
{
    public LocalTransform targetTransform = new() { Position = new float3(0,0,0)};
    public bool IsFound = false;
    public static CameraSingleton instance;

    public void Awake()
    {
        if (instance != null && instance != this)
        {
            Destroy(gameObject);
            return;
        }
        instance = this;
    }

    public void LateUpdate()
    {
        if (IsFound)
        {
            var cameraTransform = transform;
            //cameraTransform.position = new Vector3(targetTransform.Position.x, targetTransform.Position.y, targetTransform.Position.z - 10);
            //cameraTransform.LookAt(targetTransform.Position);
        }
        IsFound = false;

    }
}
